<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button id="btn">翻译</button>
    <!-- hidden 表示默认隐藏 -->
    <ul hidden id="ul">
        <li>英语</li>
        <li>法语</li>
        <li>日语</li>
        <li>毛子语</li>
        <li>德语</li>
    </ul>
    <script>
        // 点击按钮显示下拉框
        btn.onclick = function() {
            ul.style.display = 'block';
            // 阻止冒泡
            event.stopPropagation();
        }
        // 点击空白，隐藏下拉框
        document.onclick = function () {
            ul.style.display = 'none';
        }
    </script>
</body>
</html>